<template>
	<view>
		<view class="cart-title">
			<uni-icons type="shop" size="18"></uni-icons>
			<text class="cart-title-text">购物车</text>
		</view>
		<!-- 循环渲染购物车中的商品信息 -->
		
		<block v-for="(goods,i) in cart" :key="1">
			<my-goods :goods="goods" :show-num="true"></my-goods>
		</block>
	</view>
</template>

<script>
	//引用封装好的购物车角标方法
	import badgeMix from '@/mixins/tabbar-badge.js'
	//引用辅助方法
	import {
		mapState
	} from 'vuex'

	export default {
		mixins: [badgeMix],
		computed: {
			...mapState('m_cart', ['cart'])
		},
		data() {
			return {
			};
		}
	}
</script>

<style lang="scss">
	.cart-title {
		height: 40px;
		display: flex;
		align-items: center;
		padding-left: 5px;
		border-bottom: 1px solid #DCDFE6;

		.cart-title-text {
			font-size: 14px;
			margin-left: 10px;
		}
	}
</style>
